import socket as sk
import time


def main():
    # server_ip = input("Please input the server's ip Address:")
    server_ip = '127.0.0.1'
    server_port = 6666
    file = open('a.txt')
    data = file.read()
    print(data)
    tcp_client_socket = sk.socket(sk.AF_INET, sk.SOCK_STREAM)
    tcp_client_socket.connect((server_ip, server_port))
    tcp_client_socket.send(str(data).encode("utf-8"))
    time.sleep(5)
    tcp_client_socket.send(str(data).encode("utf-8"))
    time.sleep(5)
    tcp_client_socket.send("Nihao body".encode("utf-8"))
    tcp_client_socket.close()
    pass


if __name__ == '__main__':
    main()
